class MookersController < ApplicationController
  # GET /mookers
  # GET /mookers.xml
  def index
    @mookers = Mooker.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @mookers }
    end
  end

  # GET /mookers/1
  # GET /mookers/1.xml
  def show
    @mooker = Mooker.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @mooker }
    end
  end

  # GET /mookers/new
  # GET /mookers/new.xml
  def new
    @mooker = Mooker.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @mooker }
    end
  end

  # GET /mookers/1/edit
  def edit
    @mooker = Mooker.find(params[:id])
  end

  # POST /mookers
  # POST /mookers.xml
  def create
    @mooker = Mooker.new(params[:mooker])

    respond_to do |format|
      if @mooker.save
        flash[:notice] = 'Mooker was successfully created.'
        format.html { redirect_to(@mooker) }
        format.xml  { render :xml => @mooker, :status => :created, :location => @mooker }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @mooker.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /mookers/1
  # PUT /mookers/1.xml
  def update
    @mooker = Mooker.find(params[:id])

    respond_to do |format|
      if @mooker.update_attributes(params[:mooker])
        flash[:notice] = 'Mooker was successfully updated.'
        format.html { redirect_to(@mooker) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @mooker.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /mookers/1
  # DELETE /mookers/1.xml
  def destroy
    @mooker = Mooker.find(params[:id])
    @mooker.destroy

    respond_to do |format|
      format.html { redirect_to(mookers_url) }
      format.xml  { head :ok }
    end
  end
end
